﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Transactions {
    import Engine.Transactions.*;
    import Classes.*;
    import Display.*;
    import Display.NeighborUI.*;

    public class TRequestMutualFriends extends Transaction {

        private var m_neighborID:String;
        private var m_show:Boolean;

        public function TRequestMutualFriends(_arg1:String, _arg2:Boolean){
            this.m_neighborID = _arg1;
            this.m_show = _arg2;
        }
        override public function perform():void{
            signedCall("VisitorService.listMutualFriends", MutualFriendInviteDialogView.NUM_PORTRAITS, this.m_neighborID);
        }
        override protected function onComplete(_arg1:Object):void{
            var _local2:Player;
            var _local3:Array;
            if (((_arg1.hasOwnProperty("mutualFriends")) && (Global.isVisiting()))){
                _local2 = Global.player.findFriendById(Global.getVisiting());
                _local3 = _arg1["mutualFriends"];
                if (((((_local3) && (_local3.length))) && (Global.player.getShowMFIByID(_local2.uid)))){
                    Global.player.mutualFriendsDialog = new MutualFriendInviteDialog(_local2, _local3);
                    if (this.m_show){
                        UI.displayPopup(Global.player.mutualFriendsDialog);
                    };
                } else {
                    if (this.m_show){
                        NeighborVisitManager.triggerNeighborVisitFeeds();
                    };
                };
            };
        }

    }
}//package Transactions 
